<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Binary Predicate Term Details</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
MathJax = {
	tex: {
		inlineMath: '$', '$'], ['\\(', '\\)'
	},
	svg: {
		fontCache: 'global'
	}
};
</script>
<script type="text/javascript" id="MathJax-script" async
	src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>

<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script src="http://code.jquery.com/jquery-1.12.4.min.js"
	integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>

<script src="../docs-assets/Bigfoot.js"></script>
<link href="../docs-assets/Bigfoot.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Binary Predicate Term Details' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../services.html">Services</a></li><li><a href="index.html">calculus</a></li><li><a href="index.html#3">Chapter 3: Binary Predicates</a></li><li><b>Binary Predicate Term Details</b></li></ul></div>
<p class="purpose">To keep track of requirements on the terms for a binary predicate.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>Different BPs apply to different sorts of terms: for instance, the
numerical less-than comparison applies to numbers, whereas containment
applies to things. The two terms need not have the same domain: the
"wearing" relation, as seen in
</p>

<blockquote>
    <p>Harry Smythe wears the tweed waistcoat.</p>
</blockquote>

<p class="commentary">is a binary predicate \(W(x_0, x_1)\) such that \(x_0\) ranges across people
and \(x_1\) ranges across things.
</p>

<p class="commentary">It's therefore helpful to record requirements on any given term of a BP,
and we do that with the following structure.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>
</p>

<ul class="footnotetexts"><li class="footnote" id="fn:1"><p class="inwebfootnote"><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> Unary predicates do not use this structure, because it is slightly more
efficient to roughly duplicate this arrangement than to use it directly. But
the ideas are exactly the same.
<a href="#fnref:1" title="return to text"> &#x21A9;</a></p></li></ul>
<pre class="definitions code-font"><span class="definition-keyword">default</span> <span class="constant-syntax">TERM_DOMAIN_CALCULUS_TYPE</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">called_name</span><span class="plain-syntax">; </span><span class="comment-syntax"> "(called...)" name, if any exists</span>
<span class="plain-syntax">    </span><span class="constant-syntax">TERM_DOMAIN_CALCULUS_TYPE</span><span class="plain-syntax"> *</span><span class="identifier-syntax">implies_infs</span><span class="plain-syntax">; </span><span class="comment-syntax"> the domain of values allowed</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">implies_kind</span><span class="plain-syntax">; </span><span class="comment-syntax"> the kind of these values</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">i6_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">function_of_other</span><span class="plain-syntax">; </span><span class="comment-syntax"> where one term can be deduced from the other</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">index_term_as</span><span class="plain-syntax">; </span><span class="comment-syntax"> usually null, but if not, used in Phrasebook index</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">bp_term_details</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>The structure bp_term_details is accessed in 3/bp and here.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> </span><span class="function-syntax">BPTerms::new</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">BPTerms::new</span></span>:<br/><a href="3-bptd.html#SP3">&#167;3</a><br/>Binary Predicates - <a href="3-bp.html#SP9">&#167;9</a><br/>The Equality Relation - <a href="3-ter.html#SP3">&#167;3</a></span></button><span class="plain-syntax">(</span><span class="constant-syntax">TERM_DOMAIN_CALCULUS_TYPE</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">called_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">function_of_other</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">implies_infs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">infs</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">implies_kind</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">index_term_as</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> </span><span class="function-syntax">BPTerms::new_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">called_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">function_of_other</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">implies_infs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">implies_kind</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">index_term_as</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>And there is also a fuller version, including the inessentials:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> </span><span class="function-syntax">BPTerms::new_full</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">BPTerms::new_full</span></span>:<br/>The Equality Relation - <a href="3-ter.html#SP3">&#167;3</a></span></button><span class="plain-syntax">(</span><span class="constant-syntax">TERM_DOMAIN_CALCULUS_TYPE</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">CW</span><span class="plain-syntax">, </span><span class="reserved-syntax">i6_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">f</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> </span><span class="identifier-syntax">bptd</span><span class="plain-syntax"> = </span><a href="3-bptd.html#SP2" class="function-link"><span class="function-syntax">BPTerms::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">implies_kind</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">called_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CW</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">.</span><span class="element-syntax">function_of_other</span><span class="plain-syntax"> = </span><span class="identifier-syntax">f</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>In a few cases BPs need to be created before the relevant domains are known,
so that we must fill them in later, using the following:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">BPTerms::set_domain</span><span class="plain-syntax">(</span><span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bptd</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bptd</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no BPTD"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">implies_kind</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">implies_infs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TERM_DOMAIN_FROM_KIND_FUNCTION</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>Some BPs are such that \(B(x, y)\) can be true for more or less any
combination of \(x\) and \(y\). Those can take a lot of storage and it is
difficult to perform any reasoning about them, because knowing that
\(B(x, y)\) is true doesn't give you any information about \(B(x, z)\).
For instance, the BP created by
</p>

<blockquote>
    <p>Suspicion relates various people to various people.</p>
</blockquote>

<p class="commentary">is stored at run-time in a bitmap of \(P^2\) bits, where \(P\) is the number
of people, and searching it ("if anyone suspects Harry") requires
exhaustive loops, which incur some speed overhead as well.
</p>

<p class="commentary">But other BPs have special properties restricting the circumstances in
which they are true, and in those cases we want to capitalise on that.
"Contains" is an example of this. A single thing \(y\) can be (directly)
inside only one other thing \(x\) at a time, so that if we know \(C(x, y)\)
and \(C(w, y)\) then we can deduce that \(x=w\). We write this common value
as \(f_0(y)\), the only possible value for term 0 given that term 1 is \(y\).
Another way to say this is that the only possible pairs making \(C\) true
have the form \(C(f_0(y), y)\).
</p>

<p class="commentary">And similarly for term 1. If we write \(T\) for the "on top of" relation
then it turns out that there is a function \(f_1\) such that the only cases
where \(T\) is true have the form \(T(x, f_1(x))\). Here \(f_1(x)\) is the thing
which directly supports \(x\).
</p>

<p class="commentary">Containment has an \(f_0\) but not an \(f_1\) function; "on top of" has an
\(f_1\) but not an \(f_0\). Many BPs (like "suspicion" above) have neither.
</p>

<p class="commentary">Note that if \(B\) does have an \(f_0\) function then its reversal \(R\) has an
identical \(f_1\) function, and vice versa.
</p>

<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b>We never in fact need to calculate the value of \(f_0(y)\) from \(y\) during
compilation &mdash; only at run-time. So we store the function \(f_0(y)\) in an
<a href="3-cs.html#SP2" class="internal">i6_schema</a> for the necessary run-time code. For example, this might be
the schema <span class="extract"><span class="extract-syntax">ContainerOf(*1)</span></span>, which would code-generate to a function call.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">BPTerms::set_function</span><span class="plain-syntax">(</span><span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bptd</span><span class="plain-syntax">, </span><span class="reserved-syntax">i6_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">f</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bptd</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no BPTD"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">function_of_other</span><span class="plain-syntax"> = </span><span class="identifier-syntax">f</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">i6_schema</span><span class="plain-syntax"> *</span><span class="function-syntax">BPTerms::get_function</span><span class="plain-syntax">(</span><span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bptd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bptd</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no BPTD"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">function_of_other</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. </b>The kind of a term is:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="function-syntax">BPTerms::kind</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">BPTerms::kind</span></span>:<br/>Binary Predicates - <a href="3-bp.html#SP7">&#167;7</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bptd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bptd</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bptd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">implies_kind</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">implies_kind</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TERM_DOMAIN_TO_KIND_FUNCTION</span><span class="plain-syntax">(</span><span class="identifier-syntax">bptd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">implies_infs</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. </b>The table of relations in the index uses the textual name, so:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">BPTerms::index</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">bp_term_details</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bptd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bptd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">index_term_as</span><span class="plain-syntax">) { </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%s"</span><span class="plain-syntax">, </span><span class="identifier-syntax">bptd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">index_term_as</span><span class="plain-syntax">); </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bptd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">implies_infs</span><span class="plain-syntax">) </span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TERM_DOMAIN_WORDING_FUNCTION</span><span class="plain-syntax">(</span><span class="identifier-syntax">bptd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">implies_infs</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">)) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%W"</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">); </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"--"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="3-bpf.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-cm.html">1</a></li><li class="progresschapter"><a href="2-up.html">2</a></li><li class="progresscurrentchapter">3</li><li class="progresssection"><a href="3-bpf.html">bpf</a></li><li class="progresscurrent">bptd</li><li class="progresssection"><a href="3-bp.html">bp</a></li><li class="progresssection"><a href="3-ter.html">ter</a></li><li class="progresssection"><a href="3-cs.html">cs</a></li><li class="progresschapter"><a href="4-trm.html">4</a></li><li class="progresschapter"><a href="5-sc.html">5</a></li><li class="progressnext"><a href="3-bp.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

